package com.itheima.d2_byte_stream;

import java.io.FileInputStream;
import java.io.FileOutputStream;

/*
     目标：使用字节流完成对文件的复制操作。
     数据源
     目的地
 */
public class CopyTest5 {
    public static void main(String[] args) throws Exception {
        FileInputStream file1 = new FileInputStream("D:\\Desktop\\1123.txt");
        FileOutputStream file2 = new FileOutputStream("E:\\1123d\\112.txt");

        int len;
        byte[] buffer = new byte[1024];
        while ((len = file1.read(buffer)) != -1) {
            file2.write(buffer, 0, len);
        }
        file1.close();
        file2.close();

    }
}
